/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package main;

/**
 *
 * @author WinKiQue58
 */

import ActionBar.MessageOptionsLocal;
import ActionBar.PreferenceOptionsLocal;
import ActionBar.SearchOptionsLocal;
import Admin.Business_RulesLocal;
import CommonProfile.Dashboard_PrincipalLocal;
import CommonProfile.PersonalInformationLocal;
import CommonProfile.Sign_InLocal;
import CommonProfile.Sign_UpLocal;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;


/**
 *
 * @author WinKiQue58
 */
public class Test {

    private static Context jndi;
    private static Dashboard_PrincipalLocal dp;
    private static Sign_UpLocal s_up;
    private static Sign_InLocal s_in;
    private static PersonalInformationLocal pinfo;
    private static Business_RulesLocal b_rules;
    private static MessageOptionsLocal AB_message;
    
    //--missing Test
    private static PreferenceOptionsLocal AB_preference;
    private static SearchOptionsLocal AB_search;
    
    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args)  {
        try {
            Properties env = new Properties(Util.getInitProperties());
            jndi = new InitialContext(env);
            
            //---Looking Objects
            dp = (Dashboard_PrincipalLocal) jndi.lookup(Dashboard_PrincipalLocal.class.getCanonicalName());
            s_up = (Sign_UpLocal) jndi.lookup(Sign_UpLocal.class.getCanonicalName());
            s_in = (Sign_InLocal) jndi.lookup(Sign_InLocal.class.getCanonicalName());
            pinfo = (PersonalInformationLocal) jndi.lookup(PersonalInformationLocal.class.getCanonicalName());
            b_rules = (Business_RulesLocal) jndi.lookup(Business_RulesLocal.class.getCanonicalName());
            AB_message=(MessageOptionsLocal) jndi.lookup(MessageOptionsLocal.class.getCanonicalName());
            //--Testing Dashboard Principal.
           /* for (Enterprise element :  dp.getEnterprises()) {
                System.out.println(element.S3R4_toString());
            }*/
            
              //--Testing Sign UP.
            /* String nameUser="NES_DU";
            System.out.println(s_up.checkUser(nameUser));
            s_up.createSignUp(1, nameUser, "Enrique", 
                    "k", "@correo", "3134324503", "Los Reyes 14-40", 2864965, true, null, "4.7426", "-74.0639");*/
            
             //--Testing Sign IN.
           /* PersonalInfo pi=s_in.SignIn_S3R4("asd", "d");
            if (pi==null)
            {
                System.out.println("No available");
            }else if (pi.getUsertype()==0){
                System.out.println("Client");
            }            
            else if (pi.getUsertype()==1){
                System.out.println("Member");
            }
            else if (pi.getUsertype()==2){
                System.out.println("Admin");
            }*/
            
            //--Testing Personal Info.
            /*pinfo.UpdatePersonalInformation("kiquened", "OScar", "pass", "email", "3167985648", 
                    "address", "2568794", "0", "NewEnterprise","k");*/
            
            //--Testing Business_Rules
            //--Name idE and IdBE are unique!
            //b_rules.CreateRule("Level", 20.456,new BigInteger("4"), new BigInteger("1"));
            
            //--Action Bar Messages;
            /*String [] To={"Home","Search","Messages", "Preferences" };
            AB_message.CreateMessage(To, "Este es mi tesis Carachas!", "Mi correo", new BigInteger("1"), new BigInteger("1"), new BigInteger("4"));*/
            
            //AB_message.CreateOrder(new BigInteger("1"), new BigInteger("1"), new BigInteger("4"));
            
            /*Item i= AB_message.GetItem(new BigInteger("1"), new BigInteger("1"), new BigInteger("1"), new BigInteger("4"));
            Item i2=AB_message.GetItem(new BigInteger("2"), new BigInteger("1"), new BigInteger("1"), new BigInteger("4"));
            
            
            AB_message.CreateOrderItem(i,new BigInteger("1"), new BigInteger("1"), new BigInteger("1"), new BigInteger("4"));
            AB_message.CreateOrderItem(i2,new BigInteger("1"), new BigInteger("1"), new BigInteger("1"), new BigInteger("4"));
              
            AB_message.CloseOrder(new BigInteger("1"), new BigInteger("1"), new BigInteger("1"), new BigInteger("4"));*/
            
        } catch (NamingException ex) {
            Logger.getLogger(Test.class.getName()).log(Level.SEVERE, null, ex);
        }

          
    }
}
